package com.bringway.global.controller;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.bringway.global.factory.HelpCacheFactory;
import com.bringway.global.util.RequestUtils;

/**
 * 获得帮助信息HelpLoadController
 * @author qjy
 * @date 2017年2月20日09:36:19
 * */
@Controller
@RequestMapping("/helpload")
public class HelpLoadController extends JsonController{

	
	/**
	 * 获取帮助详细信息
	 * */
	@RequestMapping("getHelpHtml")
	public void getHelpHtml(HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException, IOException{
		String helpTag = RequestUtils.getStringParameter(request, "helpTag");
		response.reset();
		response.setContentType("text/html");
		String helpText = HelpCacheFactory.getCacheInstance().getHelp(helpTag);
		response.getOutputStream().write(helpText.getBytes("UTF-8"));
	}
}
